
#广告信息表
sqoop import \
--connect jdbc:mysql://node101:3306/ad_SX \
--driver com.mysql.jdbc.Driver \
--username root \
--password 123456 \
--columns 'id,product_id,material_id,group_id,ad_name,materail_url' \
--table ads \
--fields-terminated-by '\001' \
--target-dir 'hdfs://node101:8020//warehouse/ad_basic/2024-10-30/ads' \
--delete-target-dir \
--compress \
--compression-codec gzip \
--as-textfile \
--num-mappers 1 \
--null-non-string '\\N' \
--null-string '\\N'

#广告投放表
sqoop import \
--connect jdbc:mysql://node101:3306/ad_SX \
--driver com.mysql.jdbc.Driver \
--username root \
--password 123456 \
--columns 'id,ad_id,platform_id,create_time,cancel_time' \
--table ads_platform \
--fields-terminated-by '\001' \
--target-dir 'hdfs://node101:8020//warehouse/ad_basic/2024-10-30/ads_platform' \
--delete-target-dir \
--compress \
--compression-codec gzip \
--as-textfile \
--num-mappers 1 \
--null-non-string '\\N' \
--null-string '\\N'

#推广平台表
sqoop import \
--connect jdbc:mysql://node101:3306/ad_SX \
--driver com.mysql.jdbc.Driver \
--username root \
--password 123456 \
--columns 'id,platform,platform_alias_zh' \
--table platform_info \
--fields-terminated-by '\001' \
--target-dir 'hdfs://node101:8020//warehouse/ad_basic/2024-10-30/platform_info' \
--delete-target-dir \
--compress \
--compression-codec gzip \
--as-textfile \
--num-mappers 1 \
--null-non-string '\\N' \
--null-string '\\N'

#商品表
sqoop import \
--connect jdbc:mysql://node101:3306/ad_SX \
--driver com.mysql.jdbc.Driver \
--username root \
--password 123456 \
--columns 'id,name,price' \
--table product \
--fields-terminated-by '\001' \
--target-dir 'hdfs://node101:8020//warehouse/ad_basic/2024-10-30/product' \
--delete-target-dir \
--compress \
--compression-codec gzip \
--as-textfile \
--num-mappers 1 \
--null-non-string '\\N' \
--null-string '\\N'